package com.zhou.springcloud.cousumer.controller;

import com.zhou.springcloud.api.pojo.Dept;
import com.zhou.springcloud.api.serivce.DeptClientService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author zhouyongjun
 * @Description:
 * @date 2021/3/20 14:52
 */
@RestController
@RequestMapping("/consumer")
public class DeptCousumerController {

    @Autowired
    DeptClientService deptClientService = null;
    @RequestMapping("/dept/get/{id}")
    public Dept get(@PathVariable("id") Long id) {
        return deptClientService.queryById(id);
    }

    @RequestMapping("/dept/add")
    public Boolean addDept(Dept dept) {
        return deptClientService.addDept(dept);
    }
    @GetMapping("dept/list")
    public List<Dept> getAll() {
        return deptClientService.queryAll();
    }
}
